export const namespace = "contentQuestion";
import { Image } from "antd";

export const calcColumns = (params) => {
  const columns = [
    {
      title: "ID",
      hidden: process.env.UMI_ENV == "prod" ? true : false,
      width: 180,
      dataIndex: "id",
      hideInSearch: true,
    },
    {
      title: "题目名称",
      dataIndex: "questionStem",
      ellipsis: true,
      copyable: true,
    },
    {
      title: "题目分值",
      dataIndex: "score",
      hideInSearch: true,
    },
    // {
    //   title: "排序",
    //   dataIndex: "questionSort",
    //   hideInSearch: true,
    // },
    // {
    //   title: '更新人',
    //   dataIndex: 'updateBy',
    //   hideInSearch: true
    // },
    //{
    //  title: '更新时间',
    //  dataIndex: 'updateTime',
    //  hideInSearch: true
    //},
    {
      title: "状态",
      dataIndex: "status",
      // render: (state) => {
      //   return state ? <Tag border={false}>已启动</Tag> : <Tag color='#f0f'>禁用</Tag>
      // },
      valueEnum: {
        0: { text: "上架", status: "Success" },
        1: { text: "下架", status: "Default" },
      },
    },
  ];
  if (params?.operate) {
    columns.push(params?.operate);
  }
  return columns;
};
